<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="css/index2.css">
		<link rel="stylesheet" href="css/common.css">
	</head>

	<body>
		<audio src="music/bgm.mp3" id="yy" autoplay="autoplay" loop="loop"></audio>
		<header>
		
			<img src="img/tuolaji.png" alt="" />
			<!--<img src="img/jindu.gif" alt="" />-->
			<img src="img/jiantou.gif" alt="" / id="img">
			<img src="img/wheel1.gif" alt="" / id="cilun1">
			<img src="img/wheel2.gif" alt="" / id="cilun2">
				<img src="img/close.png" id="close" alt="" />
				<img src="img/yinyue.gif"/ id="yingyue">
			<div id="box">
				<p>随着农业技术的发展</p>
				<p>本应成为主食的五谷杂粮</p>
				<p>却渐渐被快餐零食所替代</p>
				<p>人们的健康水平</p>
				<p>也在餐饮条件的变化下</p>
				<p>变得参差不齐</p>
			</div>
		</header>
		
		<script type="text/javascript">
			var p=document.querySelectorAll('p')
			console.log(p)
			
//				console.log(i)
				var num=0
				var timer=setInterval(function(){
//					console.log(p)
					
					p[num].style.display='block'
					num++
					if(num>5){
						clearInterval(timer)
						var time=setTimeout(function(){
							location.href='index3.html'
							
						},3000)
					}
				},1000)
//			}
			var s1
			var s2
			var s3
			var s4
			document.ontouchstart=function(evt){
				var touch=evt.targetTouches[0];
				 s1=touch.pageX
				 s2=touch.pageY
//				console.log(s1)
				console.log(s2)
				document.ontouchmove=function(evs){
				var touch1=evs.targetTouches[0];
				 s3=touch1.pageX
				 s4=touch1.pageY
//				console.log(s3)
				console.log(s4)
				}
//				console.log(s3)
				document.ontouchend=function(){
//				var touch2=eva.targetTouches[0];
				document.ontouchmove=null;
				var s5=s4-s2
				var s6=s3-s1
				console.log(s5)
				if(s5>300){
					location.href = 'index.html'
				}else if(s5<-300){
					location.href = 'index3.html'
				}
//				console.log(s6)
//				if(){
//					
//				}
				
				}
			}
			var audi = document.getElementById('yy')
			var close = document.getElementById('close')
			var yingyue = document.getElementById('yingyue')
			yingyue.onclick = function() {
				audi.pause()
				console.log(1)
				yingyue.style.display = 'none'
				close.style.display = 'inline-block'

			}
			close.onclick = function() {
				audi.play()
				//				console.log(1)
				yingyue.style.display = 'inline-block'
				close.style.display = 'none'
			}
		</script>
	</body>

</html>